<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="../Public/js/jquery-1.7.1.min.js"></script>
<title>发表文章</title>
<script type="text/javascript">
$(document).ready(function(){  
    $("#content").keydown(function(){  
        var curLength=$("#content").val().length;   
        if(curLength>=1000){  
            var num=$("#content").val().substr(0,70);  
            $("#content").val(num);  
            alert("超过字数限制，多出的字将被截断!");  
        }  
        else{  
            var no = $("#content").val().length;
            no=no+"/1000";
            $("#textCount").text(no);  
        }  
    })  
});
function sendNoteData(){ 
    var title=$("#title").val(); 
    var nid=$("#nid").val();   
    var content=$("#content").val();
    $.post("{:U('Note/doSaveBlog')}",{nid:nid,title:title,content:content},function(data){
         var jsonObj = $.parseJSON(data);
         if(jsonObj.data!=0||jsonObj.data!=null){
             window.location.href="{:U('Note/notelist')}";
          }
          else
          {
            alert("更新失败");
          }
     });
}
 function selectitem(index){
   switch(index){
    case 0:
    window.location.href="{:U('Public/tohome')}"
    break;
    case 1:
    window.location.href="{:U('Upload/uploadpicture')}"
    break;
    case 2:
    window.location.href="{:U('Note/addBlog')}"
    break;
    case 3:
    window.location.href="{:U('First/Index')}"
    break;
    case 4:
    window.location.href="{:U('Favorite/Index')}"
    break;
    case 5:
    window.location.href="{:U('Video/addVideo')}"
    break;
    case 6:
    window.location.href="{:U('Growth/Index')}"
    break;
    case 7:
    window.location.href="{:U('Timeshow/Index')}"
    break;
   }
}
</script>
<style>

div{
	margin:0px;
	margin-left:auto;
	margin-right:auto;
	
	/*border:solid ;
	border-color:#Ff0000;*/
	}
body {
	background:#ffffff;
	margin:0px;	
}


div{
	margin-left:auto;
	margin-right:auto;
	}


.tab{
	border:thin solid #d0d0d0;
	float:left;
	height:39px;
	border-bottom:none;
	line-height:39px;
	font-size:16px;
	color:#626262;
	text-align:center;
	width:80px;
	font-weight:bold;

	}	
 .options{
	height:30px;
	width:170px;
	border-bottom:dotted #e3e3e3 1px;
	cursor:pointer;
	}
 .myfontstyle{
    font-family:'黑体';
    letter-spacing:1px;
}
</style>

</head>

<body  >
<div style="margin-top:2%;width:100%;">
	<div style="float:left;width:67%;margin-top:2%;">
    <!--logo开始-->
    <!--<div id='community_title' style="width:90%;height:52px;">
			<div id="logo" style="width:20%;border-right:solid thin #b9b9b9;height:52px;float:left; background:url(../Public/note/image/logo.png) no-repeat center center;">
			</div>
            <div style="width:70%;margin-left:15px;height:52px;float:left;">
            </div>	
		</div>-->
     <!--logo结束-->  
     <!--标题栏开始-->  
		<div style="width:90%;height:40px; background:#ecf9fe; border: thin solid #dee3e3; margin-top:10px;">
			<div class="tab myfontstyle" style="width:120px;">发表日志</div>
				<input type="text" name="nid" id="nid" value="{$note.n_id}" style="display:none;"/>
		</div>
      <!--标题栏结束-->  
 	  <!--最左区域-->
		<div  style="width:90%;background:#f7fcfe;border-top:none;border:thin solid #dee3e3; height:450px;">      
	  <!--讨论题开始-->
			<div style="width:95%;margin-left:20px;margin-top:20px; height:50px;background:url(../Public/discuss/image/line.png) repeat-x left bottom;">
            	<input type="text" name="title" id="title" value="{$note.title}" style="background:#f9fdfe;width:95%;height:25px;"/>
            </div>
	  <!--讨论题结束-->
	  <!--详细介绍开始-->
			<div style="width:95%;padding-top:20px;margin-left:20px; height:300px;background:url(../Public/discuss/image/line.png) repeat-x left bottom;">
            	<textarea id="content" name="content" style="width:95%;height:270px;">{$note.content}</textarea>
            </div>
	  <!--详细介绍结束-->
	  <!--评论栏开始-->
			<div style="width:95%;margin-left:20px;height:50px;">
            	<div style="float:left;width:102px;height:37px;background:url(../Public/discuss/image/save.png) no-repeat;cursor:pointer;" onclick="sendNoteData()"></div>
                <span id="textCount" class="myfontstyle" style="margin-left: 20px;margin-top:20px;font-size:10pt;">0/1000</span>
            </div>
	  <!--评论栏结束-->
		</div><!--最左区域-->	  
	</div><!--内容结束-->
   
<div style="float:left;width:3%;background:url(../Public/note/image/m_line.png) no-repeat right center;height:600px; "></div><!--中线-->
<!--公告开始-->
<div class="myfontstyle" style="float:left;width:30%;">
	<div style="background:url(../Public/note/image/back.png) no-repeat;width:210px;height:214px;margin-top:20px;padding-top:50px;">
    <!--	<div class="myfontstyle" style="width:80%;color:#A0A0A0;font-size:10pt;">&nbsp;&nbsp;您也许注册了一堆博客、微博，那里纷繁复杂的界面和无处不在的广告是否让你晕头转向、毫无兴致？Tang日志的设计非常简洁轻快，让您快速舒畅地记录关于宝宝的生活感触，因为Tang还知道，您每天照顾宝宝的一切，已经很忙了。
        </div>-->
    </div>
</div>
<div  id="role" style="float:left;width:30%;">
    	<div class="options" style="background:url(../Public/child/image/home.png) no-repeat;" onclick="selectitem(0)"></div>	
    	<div class="options" style="background:url(../Public/child/image/addphoto.png) no-repeat;" onclick="selectitem(1)"></div>	
    	<div class="options" style="background:url(../Public/child/image/addvideo.png) no-repeat;" onclick="selectitem(5)"></div>	
    	<div class="options" style="background:url(../Public/child/image/marker.png) no-repeat;" onclick="selectitem(3)"></div>	
    	<div class="options" style="background:url(../Public/child/image/addfavourite.png) no-repeat;" onclick="selectitem(4)"></div>	
    	<div class="options" style="background:url(../Public/child/image/addnote.png) no-repeat;" onclick="selectitem(2)"></div>	
    	<div class="options" style="background:url(../Public/child/image/grow.png) no-repeat;" onclick="selectitem(6)"></div>	
    	<div class="options" style="background:url(../Public/child/image/timeshow.png) no-repeat;" onclick="selectitem(7)"></div>		
    </div>
<!--公告结束-->
</div><!--全局框结束--> 
<img src="../Public/note/image/flower.png" style="position:absolute;right:0;bottom:0; z-index:-50;" />
</body>
</html>



